//
//  LJHBaseLable.m
//  HEARME
//
//  Created by mac on 16/3/1.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LJHBaseLable.h"

@implementation LJHBaseLable

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.font = [UIFont systemFontOfSize:13 weight:0];
        
        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"]) {
            self.textColor = [UIColor whiteColor];
        }
        else
        {
            self.textColor = [UIColor lightGrayColor];
        }
        
        
    }
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"changeColor" object:nil];
    return self;
}
-(void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"changeColor" object:nil];
    [super dealloc];
}

-(void)changeColor:(NSNotification *)notifition
{
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Mode"] isEqualToString:@"night"])
    {
        self.textColor = [UIColor whiteColor];
        
    }
    else
    {
        self.textColor = [UIColor lightGrayColor];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
